<?php
/**
 * Created by PhpStorm.
 * User: yangfan
 * Date: 2019/11/4
 * Time: 4:50 PM
 */

namespace App\Utils;

/**
 * 自动生成随机码
 * Class CouponCodeFactory
 * @package App\Utils
 */
class CouponCodeFactoryUtil
{
    /**
     * 通过 md5 生成唯一码，长度为 12 位
     * @return string
     */
    public static function get12CodeMd5()
    {
        return str_shuffle(substr(md5(time() . rand(10000, 90000)), 0, 12));
    }
}
